package com.arithmeticEveryDay.luoguOJ;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

// abcje/fghij = n
public class MainUVA725 {
    static int count = 0;
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        while (scan.hasNext()) {
            // 遍历fghij
            int n = scan.nextInt();
            boolean flag = true;
            for (int i = 1234; i <= 98765; i++) {
                int j = i * n;
                if (j < 100000 && check(j, i)) {
                    flag = false;
                    System.out.print(j + " / ");
                    for (int k = 0; k < 5-count; k++) {
                        System.out.print("0");
                    }
                    System.out.println(i + " = " + n);
                }
            }
            if (flag) {
                System.out.println("There are no solutions for " + n + ".");
            }
        }
    }
    private static boolean check(int i, int j) {
        Set<Integer> set = new HashSet<Integer>();
        count = 0;
        while (i > 0) {
            int temp = i % 10;
            i /= 10;
            if (!set.contains(temp)) {
                count++;
                set.add(temp);
            } else {
                
                return false;
            }
        }
        if (count < 4) {
            return false;
        } else if (count == 4) {
            if (!set.contains(0)) {
                set.add(0);
            } else {
                return false;
            }
        }
        count = 0;
        while (j > 0) {
            int temp = j % 10;
            j /= 10;
            if (!set.contains(temp)) {
                count++;
                set.add(temp);
            } else {
                return false;
            }
        }
        if (count < 4) {
            return false;
        } else if (count == 4) {
            if (!set.contains(0)) {
                set.add(0);
            } else {
                return false;
            }
        }
        return set.size() == 10;
    }

    

}
